<?php
define('IN_QY',true);
require("include/common.inc.php");
require_once("include/config.php");
require_once("include/httpUtil.php");
require_once('config.php');
//获取ip

//echo $res0['city'];
//获取ip
//
	$e = "insert into tbl_ip values (0,'".$onlineip."','".date('Y-m-d')."','".$res0['city']."')";	
    mysql_query($e);
 function is_weixin() {
   if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) {
       return true;
    } return false;
 }
 $is_weixin = (is_weixin() == true) ? "1" : "2";
 if($is_weixin==1){
//scope=snsapi_base 实例
$appid='wxd6671ed64906b4b4';
$redirect_uri = urlencode ( 'http://www.goodshare.com.cn/wap/mmregister.php' );
$url ="https://open.weixin.qq.com/connect/oauth2/authorize?appid=$appid&redirect_uri=$redirect_uri&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect";
header("Location:".$url);
}	
 if($is_weixin==2){
	echo "<script type='text/javascript' >location.href='mmregister.php';</script>";
	exit;
}	
?>
